
%Nx3 sites (x, y,z) edges (source, dst)
function [sites, edges]=readEdges(fileName)

sites=[];
edges=[];

fid=fopen(fileName,'r');

line=fgetl(fid);
while ischar(line)
	if numel(line)==0
		line=fgetl(fid);
		continue;
	end

	if line(1)=='s' %sites
		temp=sscanf(line(6:end), '%f',[1, 3]);
		sites=[sites; temp];
	elseif line(1)=='e' %edges
		temp=sscanf(line(6:end), '%d',[1,2]);
		edges=[edges; temp];
	end
	line=fgetl(fid);	
end

fclose(fid);

return;